<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script src="/js/jquery.js" type="text/javascript"></script>



<script src="/js/jquery-ui-1.9.1.custom.min.js"
	type="text/javascript"></script>
<script src="/js/jquery.autocomplete.js"></script>
<script src="/js/bootstrap-dropdown.js"
	type="text/javascript"></script>
<script src="/js/bootstrap-collapse.js"
	type="text/javascript"></script>

<script src="/js/bootstrap-tab.js"
	type="text/javascript"></script>
<script src="/js/bootstrap-modalmanager.js"></script>
<script src="/js/bootstrap-modal.js"></script>


</head>
<body>

<table>
<tr>
<td>Message : </td>
<td><input type="text" id="message"/></td>
</tr>
<tr>
<td>Link : </td>
<td><input type="text" id="link"/></td>
</tr>
<tr><td><input type="button" value="Post On Page" id="show"/></td></tr>
</table>

<table>
<tr>
<td>Message : </td>
<td><input type="text" id="message1"/></td>
</tr>
<tr>
<td>Link : </td>
<td><input type="text" id="link1"/></td>
</tr>
<tr>
<td>Description : </td>
<td><input type="text" id="desc"/></td>
</tr>
<tr>
<td>Title : </td>
<td><input type="text" id="title"/></td>
</tr>
<tr><td><input type="button" value="Post On User" id="showWall"/></td></tr>
</table>
 
    <div id='fb-root'></div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p>
    <a href="javascript:;" onclick='postToFeed(); return false;'>Post to Group</a>
</p>
<p id='msg'></p>


<script Language="JavaScript">

FB.init({appId: "139384839574556", status: true, cookie: true});



function postToFeed() {
FB.api('/JavaSupport/feed', 'post', 
           { 
               message     : "test"
               
               
               
       }, 
       function(response) {
           alert(JSON.stringify(response));
       });
}

        function getValye() {

            alert("Value "+window.location.hash);
            
        }

        $("#showWall").click(
				function() {
					
					var accesstoken=window.location.hash;
					var message =$('#message1').val();
					var link =$('#link1').val();  
					var desc =$('#desc').val();
					var title =$('#title').val();
					request = $.ajax({
						url : "/Post?accesstoken="+encodeURIComponent(accesstoken)+"&message="+encodeURIComponent(message)+"&link="+link+"&desc="+desc+"&title="+title+"&type=wall"
					});
					request.done(function(msg) {

						alert('Done');
					});
				});

        $("#show").click(
				function() {
					
					var accesstoken=window.location.hash;
					var message =$('#message').val();
					var link =$('#link').val();
					request = $.ajax({
						url : "/Post?accesstoken="+encodeURIComponent(accesstoken)+"&message="+encodeURIComponent(message)+"&link="+link+"&type=page"
					});
					request.done(function(msg) {

						alert('Done');
					});
				});
    </script>
   
</body>
</html>